package com.inspur.jzsxxzx.service.catalog.impl;

import com.inspur.jzsxxzx.mapper.catalog.MuluzhiliVOMapper;
import com.inspur.jzsxxzx.service.catalog.MuluzhiliVOService;
import com.inspur.jzsxxzx.vo.MuluzhiliVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;

@Service
public class MuluzhiliVOServiceImpl implements MuluzhiliVOService {
    
    @Autowired
    private MuluzhiliVOMapper muluzhiliVOMapper;
    
    @Override
    public List<MuluzhiliVO> findAll() {
        return muluzhiliVOMapper.selectAll();
    }
    
    @Override
    public List<MuluzhiliVO> findByCondition(MuluzhiliVO condition) {
        return muluzhiliVOMapper.selectByCondition(condition);
    }
    
    @Override
    public List<MuluzhiliVO> findByPage(MuluzhiliVO condition, int pageNum, int pageSize) {
        int offset = (pageNum - 1) * pageSize;
        return muluzhiliVOMapper.selectByPage(condition, offset, pageSize);
    }
    
    @Override
    public int countByCondition(MuluzhiliVO condition) {
        return muluzhiliVOMapper.countByCondition(condition);
    }
    
    @Override
    public List<MuluzhiliVO> findByDeptCode(String deptCode) {
        return muluzhiliVOMapper.selectByDeptCode(deptCode);
    }
    
    @Override
    public List<Map<String, String>> getAllDeptCodesAndNames() {
        return muluzhiliVOMapper.selectAllDeptCodesAndNames();
    }
}